//
//  Tool.h
//  iOSProjectExtension
//
//  Created by Apple on 2020/1/9.
//  Copyright © 2020 lidianchao. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


typedef NS_ENUM(NSInteger, plist_type)
{
    plist_Arrray = 0,//数组类型
    plist_String,//字符串类型
    plist_Dictionary//字典类型
};

@interface Tool : NSObject
/**
 储存到plist里面
 
 @param object 数据源
 */
+ (void)savePlistFileWithObject:(id )object withName:(NSString *)name;
+ (id )getPlistFileWithName:(NSString *)name withPlistType:(plist_type)type;
+ (void)clearPlist:(NSString *)name;

//userdefaults
//存储string
+ (void)saveStringToUserDefaults:(NSString *)string key:(NSString *)key;
+ (NSString *)getStringValueFromUserDefaults:(NSString *)key;
+ (void)saveArrayToUserDefaults:(NSArray *)array key:(NSString *)key;
+ (NSArray *)getArrayValueFromUserDefaults:(NSString *)key;
+ (void)saveDicToUserDefaults:(NSDictionary *)dic key:(NSString *)key;
+ (NSDictionary *)getDicFromDefaults:(NSString *)key;

@end

NS_ASSUME_NONNULL_END
